package com.mr.service;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import com.mr.model.BaseObject;

public interface DaoService {
   <T extends BaseObject> T saveObject(T o);
   <T extends BaseObject> T getObject(Class<T> clazz, Serializable id);
   <T extends BaseObject> T removeObject(T o);
   <T extends BaseObject> T removeObjectById(Class<T> clazz, Serializable id);
   <T extends BaseObject> List<T> getAllObjects(Class<T> clazz);
   <T extends BaseObject> int getObjectCount(Class<T> clazz);
   <T extends BaseObject> void removeObjectList(Collection<T> entityList);
   <T extends BaseObject> void saveObjectList(Collection<T> entityList);
   <T extends BaseObject> void addObjectList(Collection<T> entityList);
   <T extends BaseObject> void saveObjectList(T ... entityList);
   <T extends BaseObject> List<T> getObjectList(Class<T> clazz, String orderField, boolean asc);
   <T extends BaseObject, S extends Serializable> List<T> getObjectList(Class<T> clazz, Collection<S> idList);
   <T extends BaseObject, S extends Serializable> Map<S, T> getObjectMap(Class<T> clazz, Collection<S> idList);
   <T extends BaseObject> Map getObjectPropertyMap(Class<T> clazz, String keyname, String valuename);
   /**
    * ����������
    * @param className
    * @return
    */
   boolean clearCache(String className);
   <T extends BaseObject> T updateObject(T entity);
   <T extends BaseObject> T addObject(T entity);
   <T extends BaseObject> T getObjectByUkey(Class<T> clazz, String ukeyName, Serializable ukeyValue);
}
